import type { ArmorsModel, ResultModel, PageResultModel,FirearmsModel} from '@/api/model/model'
import request from '@/utils/request'


export const queryFirearmsPageApi = (pn: Number, pz: Number) => 
  request.get<any, PageResultModel>(`/firearms/firearmsList?pn=${pn}&pz=${pz}`)

//根据ID查询armor
export const queryFirearmsByIdApi = (id: number) => request.get<any, ResultModel>(`/firearms/getFirearmsById/${id}`)

export const updateApi = (firearms:FirearmsModel) => request.post<any, ResultModel>(`/firearms/firearmsAddOrUpdate`, firearms)
export const addApi = (firearms:FirearmsModel) => request.post<any, ResultModel>(`/firearms/firearmsAddOrUpdate`, firearms)

export const deleteApi = (id: number) => request.delete<any, ResultModel>(`/firearms/firearmsDelById/${id}`)
export const batchDeleteApi = (ids: (number| undefined)[]) => request.post<any, ResultModel>(`/firearms/firearmsBatchDelById`,ids)